﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UAC.Operation;

namespace UACManager
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        public string UserName { get; private set; }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tUN.Text))
            {
                MessageBox.Show("Login User ID is invalid！", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                return;
            }
            if (UACOp.CanRead(tUN.Text, 100101, null))
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            else
            {
                MessageBox.Show("Login Error！", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                return;
            }
        }
    }
}
